const { sequelize, DataTypes } = require('../utill/getSequelize')


const T_subjects = sequelize.define('T_subjects', {
    id: {
        type: DataTypes.INTEGER,
        primaryKey: true,
        autoIncrement: true,
    },

    subject: {
        type: DataTypes.STRING,
        allowNull: false,
    }

});


// const T_subject_paper = sequelize.define('T_subject_paper', {
//     id: {
//         type: DataTypes.INTEGER,
//         primaryKey: true,
//         autoIncrement: true,
//     },

//     subject_id: {
//         type: DataTypes.INTEGER,
//         allowNull: false,
//     },

//     paper_id: {
//         type: DataTypes.INTEGER,
//         allowNull: false,
//     },

//     num: {
//         type: DataTypes.INTEGER,
//         defaultValue: 0,
//     }

// });




(async () => {
    try {
        await sequelize.sync({ force: false });
        console.log('All models were synchronized successfully.');
    } catch (error) {
        console.log(error);
    }

})();

//提供出去
module.exports = { T_subjects };